package com.mconnect.msurvey.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;


/**
 * Cennik
 * @author mc104910
 *
 */
@Entity
@Table(name = "price_list")
public class PriceList implements Serializable{
	private int id_price;
	private List<PriceListSurvey> responderPriceList;
	private List<PriceListRecommend> recommendPriceList;
	
	@Id
	@GeneratedValue
	public int getId_price() {
		return id_price;
	}
	public void setId_price(int id_price) {
		this.id_price = id_price;
	}
	@ManyToMany(cascade={CascadeType.ALL})
	@LazyCollection(LazyCollectionOption.FALSE)
	public List<PriceListSurvey> getResponderPriceList() {
		return responderPriceList;
	}
	public void setResponderPriceList(List<PriceListSurvey> responderPriceList) {
		this.responderPriceList = responderPriceList;
	}
	@ManyToMany(cascade={CascadeType.ALL})
	@LazyCollection(LazyCollectionOption.FALSE)
	public List<PriceListRecommend> getRecommendPriceList() {
		return recommendPriceList;
	}
	public void setRecommendPriceList(List<PriceListRecommend> recommendPriceList) {
		this.recommendPriceList = recommendPriceList;
	}
	@Override
	public String toString() {
		return "PriceList [id_price=" + id_price + ", responderPriceList="
				+ responderPriceList + ", recommendPriceList="
				+ recommendPriceList + "]";
	}
	


}
